package com.caochenlei.chain;

public class Client {
    public static void main(String[] args) {
        //创建一个请求
        PurchaseRequest purchaseRequest = new PurchaseRequest(31000);
        //创建审批人员
        DepartmentApprover departmentApprover = new DepartmentApprover("张主任");
        DeanApprover deanApprover = new DeanApprover("李院长");
        ViceSchoolMasterApprover viceSchoolMasterApprover = new ViceSchoolMasterApprover("王副校");
        SchoolMasterApprover schoolMasterApprover = new SchoolMasterApprover("赵校长");
        //设置审批链
        departmentApprover.setNext(deanApprover);
        deanApprover.setNext(viceSchoolMasterApprover);
        viceSchoolMasterApprover.setNext(schoolMasterApprover);
        //开始处理请求
        departmentApprover.handleRequest(purchaseRequest);
    }
}
